package ase.eleitweg.server;

import java.rmi.server.*;
import java.rmi.*;

import com.google.inject.Inject;

import ase.eleitweg.common.*;
import ase.eleitweg.server.db.*;

public class ServerUserController extends AbstractServerController implements
		ServerUserHandle {
	
	@Inject RunManager rm;
	@Inject UserLoginInterface uli;
	public ServerUserController() {
		super();
	}

	public void logout() {

	}
	
	public void registerClient(ClientHandle ch) throws RemoteException {
		uli.addClientHandle(ch);
	}

	public RunManager getRunManager() throws RemoteException {
		//return RunController.getRemoteInstance();
		try{ return (RunManager) UnicastRemoteObject.exportObject(rm,0);
		} catch(ExportException e) {
			//the object already exported
			return rm;
		}
	}

}
